package com.example.cardemo.bean

import android.os.Parcel
import android.os.Parcelable

data class BrandBean(
    val reason: String?,
    val result: List<ResultBean>?,
    val error_code: Int?
) {
    data class ResultBean(
        val id: String?,
        val first_letter: String?,
        val brand_name: String?,
        val brand_logo: String?
    ) : Parcelable {
        constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString()
        )

        override fun writeToParcel(parcel: Parcel, flags: Int) {
            parcel.writeString(id)
            parcel.writeString(first_letter)
            parcel.writeString(brand_name)
            parcel.writeString(brand_logo)
        }

        override fun describeContents(): Int {
            return 0
        }

        companion object CREATOR : Parcelable.Creator<ResultBean> {
            override fun createFromParcel(parcel: Parcel): ResultBean {
                return ResultBean(parcel)
            }

            override fun newArray(size: Int): Array<ResultBean?> {
                return arrayOfNulls(size)
            }
        }
    }
}